<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>商品管理</title>
    <link rel="stylesheet" href="http://localhost/wasai/hdphp/Static/hdjs/hdjs.css" />
    <script type="text/javascript" src="http://localhost/wasai/hdphp/Static/Js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="http://localhost/wasai/hdphp/Static/hdjs/hdjs.min.js"></script>
    <link type="text/css" rel="stylesheet" href="http://localhost/wasai/hdphp/Static/css/common.css"/>
</head>
<body>
<div class="wrap">
    <table class="hd-table hd-table-list">
        <thead>
        <tr>
            <td width="50">id</td>
            <td>商品名称</td>
            <td width="100">价格</td>
            <!--<td width="180">库存</td>-->
            <td width="180">点击次数</td>
            <td width="100">添加时间</td>
            <td width="150">操作</td>
        </tr>
        </thead>
        <tbody>
        <?php foreach ($data as $k=>$v){?>
            <tr>
            <td width="50"><?php echo $v['gid'];?></td>
            <td><?php echo $v['gname'];?></td>
            <td width="100"><?php echo $v['shopprice'];?></td>
            <td width="180"><?php echo $v['click'];?></td>
            <td width="180"><?php echo date('y-m-d H:i:s',$v['time']);?></td>
            <td width="200">
            	<a href="<?php echo U('GoodsList/index',array('gid'=>$v[gid]));?>" class="hd-btn hd-btn-success hd-btn-sm">货品列表</a>
                <a href="<?php echo U('edit',array('gid'=>$v[gid]));?>" class="hd-btn hd-btn-primary hd-btn-sm">编辑</a>
                <a href="javascript:hd_modal_del(<?php echo $v['gid'];?>)" class="hd-btn hd-btn-danger hd-btn-sm">删除</a>
            </td>
        </tr>
        <?php }?> 
        </tbody>
    </table>
    <div class="page_hdjob">
      
    </div>
</div>

</body>
<script type="text/javascript">
	function hd_modal_del(id) {
        hd_modal({
            width: 400,//宽度
            height: 150,//高度
            title: '确认删除吗？',//标题
            content: '',//提示信息
            button: true,//显示按钮
            button_success: "确定",//确定按钮文字
            button_cancel: "取消",//关闭按钮文字
            timeout: 0,//自动关闭时间 0：不自动关闭
            shade: false,//背景遮罩
            shadeOpacity: 0.4,//背景透明度
            success: function () {//点击确定后的事件
				location.href = "http://localhost/wasai/hdphp/index.php/Admin/Goods" + '&a=del&gid=' + id;
            },
            cancel: function () {//点击关闭后的事件
				
            }
        });
    }
</script>
</html>


